import React from 'react';
import { Popover, Icon } from 'antd';
import { axhelper } from '@/shared/axhelper';

/** 创建信息
 * @param creatorName 创建人员
 * @param created 创建时间
 * @param modifierName 修改人员
 * @param modified 修改时间
 */
const AxPopover = (value = '', record = {}) => {
  const content = (
    <>
      <p>ID：{record.id}</p>
      <p>创建人员：{record.creatorName}</p>
      <p>创建时间：{record.created}</p>
      <p>修改人员：{record.modifierName}</p>
      <p>修改时间：{record.modified}</p>
      <p>
        状&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;态：
        {axhelper.getDicText('commonStatus', record.state)}
      </p>
    </>
  );
  return {
    props: {
      title: value,
    },
    children: (
      <>
        <Popover content={content} trigger="hover" placement="bottomLeft">
          <Icon type="info-circle" theme="twoTone" twoToneColor="#1890ff" />
        </Popover>
        &nbsp;{value}
      </>
    ),
  };
};

export default AxPopover;
